<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>勘察报告审查归总</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <!--<script type="text/javascript" src="/templates/act/process-xl.js"></script>-->
</head>
<body>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="opinion">本专业意见</a>
</script>
<script src="/static/js/main.js"></script>
</body>
<script>
    var configureCom = {};
    var $;
    var kcsj;
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table', 'matchDict'], function () {
        $ = layui.jquery;
        var configure = layui.configure;
        var table = layui.table;
        var sessionFun = layui.sessionFun;
        var matchDict = layui.matchDict;
        configureCom = layui.configureCom;
        var listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        kcsj = listData.ext0;
        var cols = [[
            {
                field: 'specialtyId', title: '专业', templet: function (d) {

                    return '<input type="hidden" value="' + d.specialtyId + '" name="'+d.specialtyId+'" class="zhuanye formData"><p>' + matchDict.name(d.specialtyId, configure.ALL_SPE) + '</p>'
                }
            },
            {
                field: 'expertScResult', title: '审查人', templet: function (d) {
                    if (d.resultScEditFlag) {
                        var html = '<select class="formData sc">' +
                            configureCom.selectReturnOption(configure.RESULT, d.expertScResult) +
                            '</select>';
                        return html;
                    } else {
                        return '<p>' + d.expertScName + '</p><p style="color: #ccc;">' + matchDict.name(d.expertScResult, configure.RESULT) + '</p>';
                    }
                }
            },
            {
                field: 'expertShResult', title: '审核人', templet: function (d) {
                    if (d.resultShEditFlag) {
                        var html = '<select class="formData sh">' +
                            configureCom.selectReturnOption(configure.RESULT, d.expertShResult) +
                            '</select>';
                        return html;
                    } else {
                        return '<p>' + d.expertShName + '</p><p style="color: #ccc;">' + matchDict.name(d.expertShResult, configure.RESULT) + '</p>';
                    }
                }
            },
            {
                field: 'leaderResult', title: '技术负责人', width: 200, templet: function (d) {
                    var html = '<p>' + d.leaderName + '</p>' +
                        '<select class="formData jgzy" required lay-verify="required">' + configureCom.selectReturnOption(configure.RESULT, d.leaderResult) +
                        '</select>';
                    return html;
                }
            },
            {
                field: 'checkTimes', title: '审查轮数'
            },
            {title: '操作', toolbar: '#barDemo', width: 150}
        ]];
        //渲染表格
        configureCom.postDataAjax(configure.LEADER_SPEC_RESULT_LIST_HTTP, {decId: listData.decId,kcSj:kcsj}).then(function (res) {
            var dataArr = res.prjSpecResultList;
            configureCom.tableRenderUserDefined({}, cols, dataArr, 'dataList', '500');
        });

        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_PROJECT_LIST_DATA, data);
            if (obj.event === 'opinion') {
                top.layer.open({
                    type: 2,
                    title:'本专业意见',
                    area: configureCom.Psize1,
                    content: configureCom.nocache(configure.EXAMINE_EXAMINATION_OPINION_HTML),
                    success: function (layero, index) {
                        //top.layer.full(index);
                    }
                });
            }
        });
        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });
    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = '';
            var listArr = [];
            if (!window.formVerifyFun()) {
                return false;
            }
            var arr = '';
            $('.zhuanye').each(function (index, item) {
               var zhuanye=  $(this).parents("tr").find(".zhuanye").val();
               var conclusion= $(this).parents("tr").find(".jgzy").val();
                data = data + zhuanye + '-'+ conclusion + ',';
            });
            res({result: data});
        });
    }
</script>
</html>